Skip to content

Conversation

@Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Feb 6, 2026

Use the number for translation:

/// <remarks>
/// e.g.: <code>
/// 
/// Flow detected you have installed {0} plugins, which will require {1} to run. Would you like to download {1}?
/// {2}{2}
/// Click no if it's already installed, and you will be prompted to select the folder that contains the {1} executable
/// 
/// </code>
/// </remarks>
public static string runtimePluginInstalledChooseRuntimePrompt(object? arg0, object? arg1, object? arg2) => string.Format(Flow.Launcher.Core.PublicApi.Instance.GetTranslation("runtimePluginInstalledChooseRuntimePrompt"), arg0, arg1, arg2);

Resolve #4255


Summary by cubic

Fixes the runtime prompt translation and improves setup by counting how many plugins use each language, then showing that count in the message. Skips setup when none need the environment.

  • Bug Fixes
    • Count plugins per language; return [] if none.
    • Update localized prompt to use numeric placeholders and include plugin count.
    • Use [] for empty returns; change SetPathForPluginPairs to return List.

Written for commit 517293a. Summary will update on new commits.

Count the number of plugins using each language to decide setup flow and provide more informative runtime prompts by including the plugin count in user messages.
Copilot AI review requested due to automatic review settings February 6, 2026 06:05
@prlabeler prlabeler bot added the bug Something isn't working label Feb 6, 2026
@github-actions github-actions bot added this to the 2.1.0 milestone Feb 6, 2026
@Jack251970 Jack251970 added the kind/ui related to UI, icons, themes, etc label Feb 6, 2026
@gitstream-cm
Copy link

gitstream-cm bot commented Feb 6, 2026

🥷 Code experts: no user but you matched threshold 10

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs

Activity based on git-commit:

Jack251970
FEB
JAN
DEC
NOV
OCT
SEP 17 additions & 28 deletions

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link

gitstream-cm bot commented Feb 6, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Jack251970 Jack251970 enabled auto-merge February 6, 2026 06:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This change refactors AbstractPluginEnvironment.cs to use a plugin count heuristic instead of language existence checks, standardizes empty collection returns, and narrows the SetPathForPluginPairs method signature from IEnumerable<PluginPair> to List<PluginPair>, updating all call sites accordingly.

Changes

Cohort / File(s) Summary
Plugin Environment Refactoring
Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs
Replaced language existence check with plugin count heuristic; updated user prompts to pass plugin count argument; changed empty-return patterns to consistent empty arrays/lists; narrowed SetPathForPluginPairs return type from IEnumerable<PluginPair> to List<PluginPair> with corresponding call-site adjustments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • jjw24
  • taooceros
  • Yusyuriv
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix translation issue' is vague and generic; while it relates to the changeset, it does not clearly describe the specific improvement being made (counting plugins per language and updating prompt formatting). Provide a more specific title such as 'Count plugins per language and fix translation placeholders' to better convey the primary changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses issue #4255 by implementing numeric placeholders in the translation string and counting plugins per language, which resolves the Chinese translation mistake where counts were incorrectly formatted.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to fixing the translation issue and improving the plugin environment setup flow; no out-of-scope modifications were detected.
Description check ✅ Passed The PR description is directly related to the changeset, specifying a translation improvement using numeric placeholders in localized strings.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch environment_localization

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a translation bug where the Language property (e.g., "Python") was being incorrectly passed as the plugin count parameter to a translation string, resulting in incorrect messages like "Python个插件" in Chinese translations. The fix calculates the actual plugin count and passes it to the translation function instead.

Changes:

  • Calculate plugin count before checking if any plugins use the language
  • Pass plugin count instead of language name to the translation function
  • Update return statements to use modern collection expression syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is with translation I believe.

English version:
'Flow detected you have installed {Python/TypeScript} plugins, which will require {Python/Node.js} to run. Would you like to download {Python/Node.js}?'

Changing to count requires update to the message to read better:
'Flow detected you have installed {5} plugins that will require {Python/Node.js} to run. Would you like to download {Python/Node.js}?'

@Jack251970
Copy link
Member Author

The issue is with translation I believe.

English version: 'Flow detected you have installed {Python/TypeScript} plugins, which will require {Python/Node.js} to run. Would you like to download {Python/Node.js}?'

Changing to count requires update to the message to read better: 'Flow detected you have installed {5} plugins that will require {Python/Node.js} to run. Would you like to download {Python/Node.js}?'

Oh, yeah. I will fix this translation in Crowdin.

@Jack251970 Jack251970 closed this Feb 7, 2026
auto-merge was automatically disabled February 7, 2026 10:18

Pull request was closed

@Jack251970 Jack251970 deleted the environment_localization branch February 7, 2026 10:18
@jjw24 jjw24 removed this from the 2.1.0 milestone Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working kind/ui related to UI, icons, themes, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chinese translation mistake

2 participants